<template>
  <div class="index">
    <el-container>
      <el-aside width="200px">
        <!-- 左侧导航菜单 -->
        <el-menu
        active-text-color="#aaaa00"
        default-active="/index/business"
        class="el-menu-vertical-demo"
        @select="handleSelect"
        >
          <!-- 一个 menu-item 就是一个菜单项 -->
          <el-menu-item index="/index/business">
            <el-icon><icon-menu /></el-icon>
            <span>出差申请</span>
          </el-menu-item>
          <el-menu-item index="/index/outside">
            <el-icon><document /></el-icon>
            <span>外勤打卡</span>
          </el-menu-item>
          <el-menu-item index="/index/leave">
            <el-icon><setting /></el-icon>
            <span>请假申请</span>
          </el-menu-item>
          <el-menu-item index="/index/work">
            <el-icon><setting /></el-icon>
            <span>加班申请</span>
          </el-menu-item>
        </el-menu>
      </el-aside>

      <!-- 占位组件 -->
      <router-view></router-view>

    </el-container>
  </div>
</template>

<script setup>
import {useRouter} from 'vue-router'
var $router=useRouter()

var handleSelect=(index)=>{
  $router.push(index)
}
</script>

<style scoped>
.index h5{
  text-align: center;
  margin-top: 10px;
}
</style>